import type { AxiosResponse, ResponseType } from 'axios'
import axiosInstance from '@/utils/network/axios'

export async function axg_getRawFile(
    filename: string,
    responseType: ResponseType = 'text'
): Promise<unknown> {
    const response: AxiosResponse = await axiosInstance.get(`/home/config-file?name=${filename}`, {
        responseType: responseType
    })
    if (response.data) return response.data
}

export async function axp_editRawFile(filename: string, value: string): Promise<AxiosResponse> {
    const response: AxiosResponse = await axiosInstance.post(`/home/config-file?name=${filename}`, {})
    return response
}
